#引入基本的镜像
FROM centos:7
#时区问题
RUN cd / && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
  && yum makecache \
  && yum install -y wget vim aclocal automake autoconf make gcc gcc-c++ unzip python-devel mysql-devel bzip2 libffi-devel epel-release \
  && yum clean all
  
#加载google
ENV CHROME_VERSION 125.0.6422.141
RUN wget -q -O /tmp/google-chrome.rpm https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm && \
    yum localinstall -y /tmp/google-chrome.rpm && \
    rm /tmp/google-chrome.rpm

#加载golang
RUN cd /usr/local/ && wget https://golang.google.cn/dl/go1.19.10.linux-amd64.tar.gz && tar -xvf go1.19.10.linux-amd64.tar.gz && rm -rf go1.19.10.linux-amd64.tar.gz

#加载chromedriver
RUN mkdir -p /images && cd /images && wget https://storage.googleapis.com/chrome-for-testing-public/125.0.6422.141/linux64/chromedriver-linux64.zip \
&& unzip -d ./ chromedriver-linux64.zip && mv chromedriver-linux64 chromedriver && rm -rf chromedriver-linux64.zip

# 安装golang环境
ENV GOROOT /usr/local/go
ENV GOPATH /root/go
ENV PATH $GOPATH/bin:$GOROOT/bin:$PATH
ENV GOPROXY https://goproxy.io,direct
ENV GO111MODULE auto

#安装python
RUN cd /root && wget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tgz && tar -zxvf Python-3.6.8.tgz && rm -rf Python-3.6.8.tgz
RUN cd /root/Python-3.6.8/ && ./configure --with-ssl --prefix=/usr/local/python3 && make && make install && rm -rf Python-3.6.8
RUN ln -s /usr/local/python3/bin/python3 /usr/bin/python3
RUN ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

WORKDIR /service
# 创建目录
RUN mkdir -p /service

# # 把当前目录下所有文件放入service容器文件夹下
# ADD . /service
# #设置/www123为工作目录
# WORKDIR /xxx
# # 进入service文件夹并编译go文件生成xxxexe
# RUN cd /xxx && go build -o xxxexe .
# 向外暴露端口
EXPOSE 8181
# CMD [ "-dev"]
# ENTRYPOINT ./xxxexe 
